<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>错误详情 - 开发者模式</title>
    <style>
        body {
            font-family: "Consolas", "Microsoft YaHei", sans-serif;
            background-color: #f0f0f0;
            padding: 20px;
        }
        .container {
            max-width: 1000px;
            margin: 0 auto;
            background-color: white;
            padding: 20px;
            border-radius: 4px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }
        .error-header {
            border-bottom: 1px solid #ddd;
            padding-bottom: 10px;
            margin-bottom: 20px;
        }
        .error-time {
            color: #666;
            font-size: 14px;
        }
        .error-content {
            margin: 15px 0;
        }
        .error-label {
            font-weight: bold;
            color: #dc3545;
        }
        .stack-trace {
            background-color: #f8f9fa;
            padding: 15px;
            border-radius: 4px;
            overflow-x: auto;
            font-size: 14px;
            white-space: pre-wrap;
        }
        button {
            margin-top: 15px;
            padding: 8px 16px;
            background-color: #0d6efd;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        button:hover {
            background-color: #0b5ed7;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="error-header">
        <h1>错误详情（开发者模式）</h1>
        <div class="error-time">错误时间: <c:out value="${errorTime}" /></div>
    </div>

    <div class="error-content">
        <div><span class="error-label">错误类型:</span> <c:out value="${errorType}" /></div>
        <div><span class="error-label">错误信息:</span> <c:out value="${errorMessage}" /></div>
    </div>

    <div>
        <span class="error-label">堆栈跟踪:</span>
        <div class="stack-trace"><c:out value="${stackTrace}" /></div>
    </div>

    <!-- 日志下载功能 -->
    <form action="${pageContext.request.contextPath}/downloadLog" method="get">
        <input type="hidden" name="logFileName" value="<c:out value="${logFileName}" />">
        <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
        <button type="submit">下载错误日志</button>
    </form>
</div>
</body>
</html>
